package com.skyolder.milkbee.service.dto;

import java.time.ZonedDateTime;
import java.io.Serializable;
import java.util.Objects;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


/**
 * A DTO for the Favorite entity.
 */
@Entity
public class FavoriteDTO implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1111899406423773162L;
	@Id
    private Long id;
    @Column(name = "card_id")
    private Long cardId;
    @Column(name = "user_id")
    private Long userId;
    @Column(name = "leaguer_id")
    private Long leaguerId;
    @Column(name = "created_at")
    private ZonedDateTime createdAt;
    @Column(name = "title")
    private String title;
    @Column(name = "author")
    private String author;
    @Column(name = "posted_at")
    private ZonedDateTime postedAt;
    

	public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getCardId() {
        return cardId;
    }

    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public Long getLeaguerId() {
        return leaguerId;
    }

    public void setLeaguerId(Long leaguerId) {
        this.leaguerId = leaguerId;
    }
    public ZonedDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(ZonedDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public ZonedDateTime getPostedAt() {
		return postedAt;
	}

	public void setPostedAt(ZonedDateTime postedAt) {
		this.postedAt = postedAt;
	}

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        FavoriteDTO favoriteDTO = (FavoriteDTO) o;

        if ( ! Objects.equals(id, favoriteDTO.id)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "FavoriteDTO{" +
            "id=" + id +
            ", cardId='" + cardId + "'" +
            ", userId='" + userId + "'" +
            ", leaguerId='" + leaguerId + "'" +
            ", createdAt='" + createdAt + "'" +
            '}';
    }
}
